<?php

require "DL/db.class.php";


class Booking{
     
    
    function getAllRegularBooking(){
        $dlo= new db();
        $dlo->connect();
        if($dlo->select("booking_type","type_id","description='regular'")):
            $time_id=$dlo->getResult();
            $dlo->resetResult();
            $time_id=$time_id['type_id'];
            if($dlo->select("booking LEFT JOIN time_line ON booking.time_id=time_line.time_id","*","booking.booking_type_id=$time_id")):
                    return $dlo->getResult();
             else:
                return false;
            endif;
        else:
               return false;

        
        endif;
       
    }
    function getAllBookingRequest(){
        $dlo= new db();
        $dlo->connect();
        if($dlo->select("booking_type","type_id","description = 'makeup'")):
            $time_id=$dlo->getResult();
            $dlo->resetResult();
            $time_id=$time_id['type_id'];
            if($dlo->select("booking LEFT JOIN time_line ON booking.time_id=time_line.time_id","*","booking.booking_type_id=$time_id")):
                    return $dlo->getResult();
            else:
                return false;
            endif;
        else:
               return false;


        endif;

    }


    function acceptBookingResquest($booking_id){

        $dlo = new db();
        $dlo->update("booking", $rows, $where);
    }
   
}

?>
